//volume section

			
function calcLength(){
	
	newt1 = parseFloat(document.frm1.t1.value);
	
  	 // convert to cubic mm
	if(document.frm1.list1.selectedIndex == 1) {newt1 *= 1000;}
	if(document.frm1.list1.selectedIndex == 2) {newt1 *= 1000000;}		
	if(document.frm1.list1.selectedIndex == 3) {newt1 *= 28300000;}
	if(document.frm1.list1.selectedIndex == 4) {newt1 *= 100000000;}
	if(document.frm1.list1.selectedIndex == 5) {newt1 *= 16387;}
	if(document.frm1.list1.selectedIndex == 6) {newt1 *= 1000000;}
	if(document.frm1.list1.selectedIndex == 7) {newt1 *= 1000000000;}
	if(document.frm1.list1.selectedIndex == 8) {newt1 *= 1000;}
	if(document.frm1.list1.selectedIndex == 9) {newt1 *= 1;}
	if(document.frm1.list1.selectedIndex == 10){newt1 *= 29574;}
	if(document.frm1.list1.selectedIndex == 11){newt1 *= 4546100;}
	if(document.frm1.list1.selectedIndex == 12){newt1 *= 568300;}
	if(document.frm1.list1.selectedIndex == 13){newt1 *= 29574;}
	if(document.frm1.list1.selectedIndex == 14){newt1 *= 3785400;}
	if(document.frm1.list1.selectedIndex == 15){newt1 *= 473100;}


		
	 // convert to user's choice
	if(document.frm1.list2.selectedIndex == 1) {newt1 /= 1000;}
	if(document.frm1.list2.selectedIndex == 2) {newt1 /= 1000000;}		
	if(document.frm1.list2.selectedIndex == 3) {newt1 /= 28300000;}
	if(document.frm1.list2.selectedIndex == 4) {newt1 /= 100000000;}
	if(document.frm1.list2.selectedIndex == 5) {newt1 /= 16387;}
	if(document.frm1.list2.selectedIndex == 6) {newt1 /= 1000000;}
	if(document.frm1.list2.selectedIndex == 7) {newt1 /= 1000000000;}
	if(document.frm1.list2.selectedIndex == 8) {newt1 /= 1000;}
	if(document.frm1.list2.selectedIndex == 9) {newt1 /= 1;}
	if(document.frm1.list2.selectedIndex == 10) {newt1 /= 29574;}
	if(document.frm1.list2.selectedIndex == 11){newt1 /= 4546100;}
	if(document.frm1.list2.selectedIndex == 12){newt1 /= 568300;}
	if(document.frm1.list2.selectedIndex == 13){newt1 /= 29574;}
	if(document.frm1.list2.selectedIndex == 14){newt1 /= 3785400;}
	if(document.frm1.list2.selectedIndex == 15){newt1 /= 473100;}

	//fnewt1 = reducedec(newt1);
	document.frm1.result.value = newt1;
}	
function reducedec(newt1){

strn = newt1.toString();
if(strn.indexOf(".") != -1)
{ io = strn.indexOf(".");
  strn4 = strn.substring(io, (io+5));
  ent = strn.substring(0,io);
  fnewt1 = ent+strn4;
  if(fnewt1.indexOf(".") == 0)fnewt1 = "0"+fnewt1;
}
else {fnewt1 = newt1;}
 return fnewt1;
}



function checkt1(){
	
	if(isNaN(document.frm1.t1.value)){
			document.frm1.t1.value="";
			document.frm1.t1.focus();  
	}
}
